home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / battlefi.swf / scripts / frame_638 / PlaceObject2_369_21 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2010-11-09  |  1KB  |  54 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.vic)
  3.    {
  4.       this._y = 491.2;
  5.    }
  6.    if(!this.hitTest(_root.castlerang))
  7.    {
  8.       this._x += speed;
  9.    }
  10.    if(duped && _root.population < _root.poptot)
  11.    {
  12.       _root.population = _root.population + 1;
  13.       _root.gold -= 150;
  14.       i++;
  15.       duplicateMovieClip(_root.arch,"MC2" + i,16384 + (100 + i));
  16.       _root["MC2" + i]._x = -6.399999999999999;
  17.       _root["MC2" + i]._y = random(50) + 251.7;
  18.       _root.ar.duped = true;
  19.       duped = false;
  20.    }
  21.    if(this.hitTest(_root.castlerang) && !attkin)
  22.    {
  23.       this.gotoAndPlay("attk");
  24.       attkin = true;
  25.    }
  26.    if(this.dead && this._currentframe < 41)
  27.    {
  28.       this.gotoAndPlay("die");
  29.    }
  30.    l = _root.lvl;
  31.    while(l < _root.lvl + 0.1)
  32.    {
  33.       if(this.hit.hitTest(_root["a" + l]))
  34.       {
  35.          this.gotoAndPlay("die");
  36.          _root["a" + l].removeMovieClip();
  37.       }
  38.       l++;
  39.    }
  40.    if(this.dead)
  41.    {
  42.       this._x -= speed;
  43.    }
  44.    if(this.deadfull)
  45.    {
  46.       this._x = -1000000000;
  47.    }
  48.    if(this.hit.hitTest(_root.castle["th" + _root.castle.thing.i]))
  49.    {
  50.       this.gotoAndPlay("die");
  51.       _root.castle["th" + _root.castle.thing.i].removeMovieClip();
  52.    }
  53. }
  54.